<%@page import="service.SellerService"%>
<%@page import="entities.SellerEntity"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'sellerfee.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/selectMonth.js"></script>
<link rel="stylesheet" type="text/css" href="css/selectMonth.css">

<script type="text/javascript">
$(document).ready(function(){
	$("#lookBt").click(function(){ 
		var  date = $("input#val").val();
			var rowHtml = "";
		
		$.ajax({
			type : "POST",
			url : "servlet/SellerCountServlet",
			data: "date="+date,
			dataType:"json",
			success : function(result) {
				for(var i = 0; i < result.length; i++){
					data = result[i];
					$("#counted_" + data.id).html(data.counted);
					//$("#uncounted_" + data.id).html(data.uncounted);
					//$("#total_" + data.id).html(data.total);
				}
					//alert(result);
					//$(".center").html(result);
			}
		});	
	});
	
	
});

 </script>

</head>

<body>
	<!-- 时间选择器1 -->
	<input id="val" name="saledate" onClick="showTime(this,'div1',2013);" />
	<div id="parenDiv">
		<!-- 对应时间选择器1 -->
		<div id='div1' class="div1" style="position:absolute; margin-right:0px;"> 
	</div>
	</div>
	<button id="lookBt" value="点击">查看</button>
	<div class="center">
	<c:set var="sellerList" value="<%=SellerService.getSellers(1)%>"></c:set>
		<%
			//List<SellerEntity> sellerList  =  SellerService.getSellers(1);
				//for(SellerEntity seller :sellerList){
		%>
		<c:forEach items="${sellerList}" var="seller">
		<div class="block" style="float:left;width:300px;height:300px;">
			 <img width="70%"
				height="50%" src="${seller.logoURL}" /><br/>
				<span style="width:100px;displa:block;margin-left:10px;margin-top:5px;">店主：${seller.owner}</span><br/>
				<span style="width:200px;displa:block;margin-left:10px;margin-top:5px;">联系电话：${seller.tel}</span><br/>
				<span style="width:200px;displa:block;margin-left:10px;margin-top:5px;">应付商家：<span id="counted_${seller.id}"></span>&nbsp;&nbsp;元</span><br/>
	
		</div>
		</c:forEach>
		<%
			//}
		%>
	</div>
</body>

</html>
